﻿@page
@{ Layout = "_Layout"; }

<el-card>
    <div slot="header" class="clearfix">
        <span>请选择</span>
        <el-button style="float: right;padding:3px 0;" type="text" v-on:click="utils.closeLayerSelf"><i class="el-icon-close"></i></el-button>
    </div>
    <el-form :size="euiSize" v-on:submit.native.prevent :inline="true" :model="formInline">
        <el-form-item label="排序">
            <el-select v-model="formInline.order" placeholder="排序">
                <el-option label="<默认>" value=""></el-option>
                <el-option label="登录名称" value="UserName"></el-option>
                <el-option label="上次登录日期" value="LastActivityDate"></el-option>
                <el-option label="创建日期" value="CreatedDate"></el-option>
                <el-option label="登录次数" value="CountOfLogin"></el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="上次登录">
            <el-select v-model="formInline.lastActivityDate" placeholder="上次登录">
                <el-option label="<全部时间>" :value="0"></el-option>
                <el-option label="1天内" :value="1"></el-option>
                <el-option label="2天内" :value="2"></el-option>
                <el-option label="3天内" :value="3"></el-option>
                <el-option label="1周内" :value="7"></el-option>
                <el-option label="1个月内" :value="30"></el-option>
                <el-option label="3个月内" :value="90"></el-option>
                <el-option label="半年内" :value="180"></el-option>
                <el-option label="1年内" :value="365"></el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="关键字">
            <el-input v-model="formInline.keyword" placeholder="关键字" clearable></el-input>
        </el-form-item>

        <el-form-item>
            <el-button type="primary" :size="euiSize" v-on:click="btnSearchClick" icon="el-icon-search">查 询</el-button>
        </el-form-item>
    </el-form>
    <el-table ref="administratorsTable"
              :size="euiSize"
              :height="$(window).height()-263"
              highlight-current-row :row-style="{ cursor: 'pointer' }" v-on:current-change="selectCurrentChange"
              :data="administrators">
        <el-table-column label="#"
                         type="index"
                         width="60"
                         align="left">
            <template scope="scope">
                <span>{{(formInline.currentPage - 1) * formInline.limit + scope.$index + 1}}</span>
            </template>
        </el-table-column>
        <el-table-column label="账号">
            <template slot-scope="scope">
                <el-link :underline="false" type="primary" v-on:click="btnViewClick(scope.row)">{{scope.row.userName}}</el-link>
            </template>
        </el-table-column>
        <el-table-column prop="displayName"
                         label="姓名">
        </el-table-column>
        <el-table-column prop="organ"
                         label="组织">
        </el-table-column>
        <el-table-column width="158"
                         prop="lastActivityDate"
                         label="上次登录">
        </el-table-column>
        <el-table-column prop="countOfLogin"
                         label="登录次数">
        </el-table-column>
        <el-table-column prop="roles"
                         label="权限">
        </el-table-column>
        @await Html.PartialAsync("_PartialTableEmpty")
    </el-table>
    <div style="height:12px;"></div>
    <el-row>
        <el-col :span="24" align="center">
            <el-pagination v-on:current-change="handleCurrentChange"
                           :current-page="formInline.currentPage"
                           background
                           :page-size="formInline.limit"
                           layout="total, prev, pager, next, jumper"
                           :total="count">
            </el-pagination>
        </el-col>
    </el-row>
</el-card>
<el-row align="center" style="margin-top:18px;">
    <el-col :span="24" align="center">
        <el-button type="primary" v-on:click="btnSelectConfirmClick" :size="euiSize">确 定</el-button>
        <el-button icon="el-icon-close" :size="euiSize" v-on:click="utils.closeLayerSelf">关 闭</el-button>
    </el-col>
</el-row>
@section Scripts{
    <script src="/sitefiles/assets/js/admin/common/selectAdministrators.js" type="text/javascript"></script>
}